package biz

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"gorm.io/gorm"
	"phm/models/generator/model"
)

type FiRadarTypeRepo interface {
	CreateFiRadarType(ctx context.Context, uModel *model.FiRadarType, db *gorm.DB) error
	UpdateFiRadarType(ctx context.Context, uModel *model.FiRadarType, db *gorm.DB) error
	DeleteFiRadarTypeByIds(ctx context.Context, ids []string, db *gorm.DB) error
	GetFiRadarTypeById(ctx context.Context, id string) (*model.FiRadarType, error)
	GetFiRadarTypeByIds(ctx context.Context, ids []string) ([]*model.FiRadarType, error)
	GetFiRadarTypeList(ctx context.Context, query string, pageNum, pageSize int64) ([]*model.FiRadarType, int64, error)
	// GetDB 得到db以方便事务处理
	GetDB() *gorm.DB
}

type FiRadarTypeUseCase struct {
	fiRadarType FiRadarTypeRepo
	log         *log.Helper
}

func NewFiRadarTypeUseCase(fiRadarType FiRadarTypeRepo, logger log.Logger) *FiRadarTypeUseCase {
	return &FiRadarTypeUseCase{
		fiRadarType: fiRadarType,
		log:         log.NewHelper(logger),
	}
}
